package org.zjx.file;

import java.io.File;
import java.io.IOException;
import java.util.List;

public interface FileOperations {
    // 存在性检查
    boolean exists(String path);

    // 文件操作
    boolean createNewFile(String path) throws IOException;
    void delete(String path);

    // 元数据获取
    long getFileSize(String path);
    long getLastModifiedTime(String path);

    // 内容读写
    void writeBytes(String path, byte[] content) throws IOException;
    void writeText(String path, String content) throws IOException;
    byte[] readBytes(String path) throws IOException;
    String readText(String path) throws IOException;

    // 路径处理
    String getFileNameWithExtension(String path);
    String getFileNameWithoutExtension(String path);
    String getFileExtension(String path);

    // 目录操作
    List<File> listFiles(String dirPath, String... extensions);
    List<String> getAllFilePaths(String dirPath);
}
